package com.pactera.madp.cp.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.Assert;

@Getter
@AllArgsConstructor
public enum SendMsgAgentEnum {

    XJEH("ww94154cef0377afdd", 1000008),
    TN("ww6bde3553ebd2b79e", 1000009),
    WS("wwa63bb6609ea1a7b2", 1000018),
    ZD("ww8ea1448046aba1ad", 1000008);

    private String id;

    private Integer agentId;

    public static SendMsgAgentEnum findByType(String id){
        Assert.notNull(id, "资源类型类型值不能为空!");
        for(SendMsgAgentEnum sendMsgAgentEnum: values()){
            if(id.equals(sendMsgAgentEnum.id)){
                return sendMsgAgentEnum;
            }
        }

        throw new IllegalArgumentException("参数异常,参数值不在允许的值范围之内!");
    }

}
